#ifndef POOL_H
#define POOL_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <semaphore.h>
#include "queue.h"



struct threadpool
{
	int queue_max_num;
	int count;

	struct task_queue *que;

	sem_t semr;
	sem_t semw;
	pthread_mutex_t mutex;

	pthread_t *tids;

};

struct threadpool *create_threadpool(int,int);
int threadpool_add_task(struct threadpool *pool,CALLBACK callback_function,void *arg);
int threadpool_destroy(struct threadpool *pool);

#endif

